from django.db import models

IP_MAX_LEN = 39 # maximum length for ipv6

class SPS(models.Model):
	SPS_TYPES = [
		('TCP', 'TCP encrypted tunnel'),
		('UDP', 'UDP encrypted tunnel'),
		('HTTP', 'HTTP encryped tunnel'),
		('HTTPS', 'HTTPS encryped tunnel'),
	]
	type = models.CharField(max_length=1, choices=SPS_TYPES)
	port = models.PositiveIntegerField(null=True)
	ip_address = models.CharField(max_length=IP_MAX_LEN, null=True)
	url = models.TextField(null=True)
	secretkey = models.TextField()
	last_update_date = models.DateField(auto_now=True)
